/*
 * ICamera.h
 *
 *  Created on: 22.03.2013
 *      Author: OrGeJs
 */

#ifndef ICAMERA_H_
#define ICAMERA_H_

#include <cstdint>
#include <string>

using namespace std;

enum DisplayMode {
	NO_DISPLAY_MODE_AVAILABLE = 0,
	DIB_MODE = 1,
	OPEN_GL_MODE = 2,
	DIRECT_3D_MODE = 3
};

enum ColorMode {
	NO_COLOR_MODE_AVAILABLE = 0, MONO8 = 1, RAW8 = 2,
};

enum ErrorCode {
	SUCCESS = 0, NOT_SUCCESS = 1
};

struct CameraParameter {
	uint8_t id;
	uint16_t width;
	uint16_t height;
	uint16_t frameRate;
	uint16_t exposureTime;
	uint16_t pixelRate;

};

class ICamera {

public:

	virtual ~ICamera() {
	}
	;

	virtual ErrorCode openCamera()=0;
	virtual ErrorCode closeCamera()=0;

	virtual ErrorCode captureVideo()=0;
	virtual ErrorCode stopVideo()=0;

	virtual ErrorCode getImageFormat(uint16_t *width, uint16_t *height)=0;
	virtual ErrorCode setImageFormat(uint16_t *width, uint16_t *height)=0;

	virtual ErrorCode setFrameRate(uint16_t *frameRate)=0;
	virtual ErrorCode getFrameRate(uint16_t *frameRate)=0;

	virtual ErrorCode setExposureTime(uint16_t *exposureTime)=0;
	virtual ErrorCode getExposureTime(uint16_t *exposureTime)=0;

	virtual ErrorCode setPixelRate(uint16_t *pixelRate)=0;
	virtual ErrorCode getPixelRate(uint16_t *pixelRate)=0;

	virtual ErrorCode setAutoPameter()=0;
	virtual ErrorCode getAllPameter()=0;

	virtual ErrorCode getId(uint8_t *id)=0;

	virtual ErrorCode resetToDefault()=0;
	virtual string getErrors()=0;

	virtual DisplayMode getDisplayMode() = 0;
	virtual void setDisplayMode(DisplayMode displayMode) = 0;
	virtual void getFrame(cv::Mat& mat)=0;

};

#endif /* CAMERAINTERFACE_H_ */
